]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
status/network: Emit 'icon-changed' on primary connection changes
authorFlorian Müllner <fmuellner@gnome.org>
Fri, 5 Aug 2022 11:21:26 +0000 (13:21 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Sun, 7 Aug 2022 20:41:09 +0000 (22:41 +0200)
When deciding on whether to show the 'no-route' icon, we check
for the client's connectivity *and* whether the devices's active
connection is used as primary connection.

This is currently masked by the indicator updating the icon on
connection changes anyway, but items should still notify the
change themselves.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2406>

js/ui/status/network.js

index d6cad562411938beee53c26833d6361302df16d5..0ae423b68204357c261d67d77afb9e6674bc506e 100644 (file)
@@ -337,6 +337,10 @@ var NMConnectionDevice = class NMConnectionDevice extends NMConnectionSection {
         this._autoConnectItem = this.item.menu.addAction(_("Connect"), this._autoConnect.bind(this));
         this._deactivateItem = this._radioSection.addAction(_("Turn Off"), this.deactivateConnection.bind(this));
 
+        this._client.connectObject(
+            'notify::primary-connection', () => this._iconChanged(),
+            this);
+
         this._device.connectObject(
             'state-changed', this._deviceStateChanged.bind(this),
             'notify::active-connection', this._activeConnectionChanged.bind(this),
@@ -1267,7 +1271,9 @@ var NMDeviceWireless = class extends Signals.EventEmitter {
         this._client.connectObject(
             'notify::wireless-enabled', this._sync.bind(this),
             'notify::wireless-hardware-enabled', this._sync.bind(this),
-            'notify::connectivity', this._iconChanged.bind(this), this);
+            'notify::connectivity', () => this._iconChanged(),
+            'notify::primary-connection', () => this._iconChanged(),
+            this);
 
         this._device.connectObject(
             'notify::active-access-point', this._activeApChanged.bind(this),